package ddl;

import org.apache.commons.logging.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.security.*;

public class LoadCtx{
	public static void main(String[] arg){
		Policy.setPolicy(new AWSPolicy());
		Log log=LogFactory.getLog(LoadCtx.class);
		ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:applicationContextJpa.xml");
		log.info("---ok");
	}
	private static class AWSPolicy extends Policy {
		private final Policy defaultPolicy;
		public AWSPolicy() {
			super();
			defaultPolicy = Policy.getPolicy();
		}
		public boolean implies(ProtectionDomain domain, Permission permission) {
			if (permission instanceof javax.management.MBeanTrustPermission) {
				return true;
			} else {
				return defaultPolicy.implies(domain, permission);
			}
		}
	}
}